﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Entity;

namespace DAO
{
    public class QuotationDAO
    {
        BMS_DatabaseEntities context = new BMS_DatabaseEntities();

        public List<QuotationEntity> LoadQuotaion(string company)
        {
            var query = from c in context.QUOTATION_INFO
                        where c.COMPANY_NAME == company
                        select new QuotationEntity
                        {
                            CompanyName = c.COMPANY_NAME,
                            ContactPerson = c.CONTACT_PERSON,
                            Departure = (DateTime)c.DEPARTURE,
                            Destination = c.DESTINATION,
                            QuotationCode = c.QUOTA_CODE,
                            QuotationDate = (DateTime)c.QUOTA_DATE,
                            QuotationValidity = (DateTime)c.QUOTA_VALIDITY,
                        };
            return query.ToList<QuotationEntity>();
        }
    }
}
